High-level languages for low-level programming
نویسنده
چکیده
ions Abstractions have a cost. File systems and network protocols are generic and not tailored to one particular application. We cannot expect an abstraction to be optimal with respect to every application that uses it. Similarly on the PL side one cannot expect a general purpose PL to provide the exact abstractions needed for one particular application. These abstractions too have a cost: they reduce performances or impose a certain style to the programmers. This cost is often paid whether the abstractions are actually used or not (e.g. tail-calls are not optimised in Python even when debugging functionalities are not used). However, abstractions are useful. Chief among their strengths is genericity. It makes code portable (across systems that ship the required set of abstractions) and coders more efficient (by allowing them to apply the same technologies to different projects). It is generally admitted that the portability of C is one of the reasons Unix got so much traction—even though switching to (what was at the time considered) a high-level PL was controversial. Increasingly numerous and higher abstractions are necessary to effectively build ever-more-complex systems. Abstraction clash Currently, low-level code (i.e. code that runs in the lower layers of system abstractions, code that runs close to the metal; e.g. code for file systems, network stacks, process schedulers), is written in low-level PLs, in one low-level PL in particular: C1,2. The reason C is a good PL for such tasks is twofold: it offers various abstractions (e.g. functions, unions, structs), and these abstractions are provided in a way that does not impede fine-grain control over the dynamic behaviour of programs3 (e.g. the dynamic layout of unions and structs in C are simple and very easy to predict whereas ADT in Haskell or ML are not).ion clash Currently, low-level code (i.e. code that runs in the lower layers of system abstractions, code that runs close to the metal; e.g. code for file systems, network stacks, process schedulers), is written in low-level PLs, in one low-level PL in particular: C1,2. The reason C is a good PL for such tasks is twofold: it offers various abstractions (e.g. functions, unions, structs), and these abstractions are provided in a way that does not impede fine-grain control over the dynamic behaviour of programs3 (e.g. the dynamic layout of unions and structs in C are simple and very easy to predict whereas ADT in Haskell or ML are not). In low-level code, it is necessary to take care of some details. In fact, code that takes care of execution-time details is by definition low-level code (i.e. code that does not rely on abstractions). It is important to note that low-level code is necessary: in order to provide an abstraction for a part of the system, a programmer needs to deal with all the details of this part of the system manually. 1C was once considered high-level, it is now on the very bottom of the PL heap just atop assembly. 2There are projects of network stacks in higher-level PLs (e.g. FoxNet [1], Mirage [2]); however, these are not widely deployed, use some C internally, and suffer from performance issues. 3For additional details, see “the costs of abstraction” talk on http://suckless.org/conference.
منابع مشابه
High-Level vs Low-Level Parallel Programming for Scientific Computing
This talk briefly reviews some of the most popular high-level and low-level parallel programming languages used for scientific computing. We will report our experiences of using these languages in our research and compare the performance of several parallel scientific equation solvers implemented in different parallel languages. Major features and comparisons of these languages will be discusse...
متن کاملForeign-Function Interfaces for Garbage-Collected Programming Languages
Programs in high-level, garbage-collected programming languages often need to access libraries that are written in other programming languages. A foreign-function interface provides a high-level language with access to low-level programming languages and negotiates between the inside and the outside world by taking care of the low-level details. In this paper, I provide an overview of what diff...
متن کاملOn Eliminating Redundant Computation from High-Level Array Statements
High-level array programming languages are well-suited for scientific computing. Such languages free the programmer from the responsibility of managing burdensome low-level details that complicate programming in languages like C and Fortran. But these details do not vanish. We argue that the compiler should relieve the programmer of this burden. In this paper, we present a compiler optimization...
متن کاملThe Design of Terra: Harnessing the Best Features of High-Level and Low-Level Languages
Applications are often written using a combination of high-level and low-level languages since it allows performance critical parts to be carefully optimized, while other parts can be written more productively. This approach is used in web development, game programming, and in build systems for applications themselves. However, most languages were not designed with interoperability in mind, res...
متن کاملSecurity types preserving compilation
Starting from the seminal work of Volpano and Smith, there has been growing evidence that type systems may be used to enforce confidentiality of programs through non-interference. However, most type systems operate on high-level languages and calculi, and “low-level languages have not received much attention in studies of secure information flow” (Sabelfeld and Myers, [1]). Therefore, we introd...
متن کاملSecurity Types Preserving Compilation: (Extended Abstract)
Initiating from the seminal work of Volpano and Smith, there has been ample evidence that type systems may be used to enforce confidentiality of programs through non-interference. However, most type systems operate on high-level languages and calculi, and “low-level languages have not received much attention in studies of secure information flow” (Sabelfeld and Myers, [16]). Further, security t...
متن کامل